package com.lib.fastkit.db.shared_prefrences.impl;

import android.content.Context;

import com.lib.fastkit.db.shared_prefrences.interfaces.UserCacheInterface;

/**
 * Desc : 缓存
 * Author : Lauzy
 * Date : 2018/4/3
 * Blog : http://www.jianshu.com/u/e76853f863a9
 * Email : freedompaladin@gmail.com
 */
public class UserCacheImpl extends SharedPreferenceModel implements UserCacheInterface {

    private static final String FILE_NAME = "USER";

    private static final String Key_User_Name = "UserName";
    private static final String Key_Is_Login = "IsLogin";
    private static final String Key_Token = "Token";
    private static final String Key_Identity = "Identity";
    private static final String Key_User_Head_Url = "UserHeadUrl";
    private static final String Key_User_Phone = "UserPhone";
    private static final String Key_User_Money = "UserMoney";
    private static final String Key_Qi_Niu_Token = "QiNiuToken";
    private static final String Key_Qi_Niu_Url = "QiNiuUrl";
    private static final String Key_You_Meng_Token = "YouMengToken";
    private static final String Key_Message_State = "Message_State";

    private static final String Key_setShow = "IsShow";

    private static final String Key_XieYiUrl = "XieYiUrl";

    private static final String Key_ZhiFuXieYiUrl = "ZhiFuXieYiUrl";

    private static final String Key_BussessType = "BussessType";

    private static final String Key_CourseId = "CourseId";

    private static final String Key_IsShowActivity = "IsShowActivity";

    private static final String Key_Config_Json = "Config_Json";

    private static final String Key_WhiteBroadImg = "WhiteBroadImg";

    private static final String Key_ZhiBoShow = "ZhiBoShow";

    private static final String Key_InvitaUserId = "InvitaUserId";

    private static final String Key_PageType = "PageType";

    private static final String Key_PageData = "PageData";

    //是否为平台老师
    private static final String Key_Platform_teacher = "Platform_teacher";

    //是否在等待老师辅导
    private static final String Key_IsWaitTeacher = "IsWaitTeacher";

    //保存是否为第一次进入平板主页
    private static final String Key_IsFirtShowMainFragment = "IsFirtShowMainFragment";


    public UserCacheImpl(Context context) {
        super(context, FILE_NAME, Context.MODE_PRIVATE);
    }


    @Override
    public void setIsFirtShowMainFragment(int isFirst) {
        put(Key_IsFirtShowMainFragment, isFirst);
    }

    @Override
    public int getIsFirtShowMainFragment() {
        return getInt(Key_IsFirtShowMainFragment);
    }


    @Override
    public void setIsWait(int isWait) {
        put(Key_IsWaitTeacher, isWait);
    }

    @Override
    public int getIsWait() {
        return getInt(Key_IsWaitTeacher);
    }


    @Override
    public void setPlatform_teacher(int platform_teacher) {
        put(Key_Platform_teacher, platform_teacher);
    }

    @Override
    public int getPlatform_teacher() {
        return getInt(Key_Platform_teacher);
    }

    @Override
    public void setPageType(int pageType) {
        put(Key_PageType, pageType);
    }

    @Override
    public int getPageType() {
        return getInt(Key_PageType);
    }

    @Override
    public void setPageData(String pageData) {
        put(Key_PageData, pageData);
    }

    @Override
    public String getPageData() {
        return getString(Key_PageData);
    }

    /**
     * 设置的set和get
     */


    @Override
    public void setInvitaUserId(String userId) {
        put(Key_InvitaUserId, userId);
    }

    @Override
    public String getInvitaUserId() {
        return getString(Key_InvitaUserId);
    }

    @Override
    public void setShowZhiboGuide(boolean isShow) {
        put(Key_ZhiBoShow, isShow);
    }

    @Override
    public boolean getShowZhiboGuide() {
        return getBoolean(Key_ZhiBoShow);
    }


    public void setWhiteBroadImgUrl(String imgUrl) {
        put(Key_WhiteBroadImg, imgUrl);
    }

    public String getWhiteBroadImgUrl() {
        return getString(Key_WhiteBroadImg);
    }


    public void setActivityKey(String isShow) {
        put(Key_IsShowActivity, isShow);
    }

    public String getActivityKey() {
        return getString(Key_IsShowActivity);
    }


    public void setBussessType(String type) {
        put(Key_BussessType, type);
    }

    public String getBussessType() {
        return getString(Key_BussessType);
    }


    public void setCourseId(String courseId) {
        put(Key_CourseId, courseId);
    }

    public String getCourseId() {
        return getString(Key_CourseId);
    }


    public void setZhifuXieYi(String url) {
        put(Key_ZhiFuXieYiUrl, url);
    }

    public String getZhifuXieYi() {
        return getString(Key_ZhiFuXieYiUrl);
    }

    @Override
    public void setXieYiUrl(String url) {
        put(Key_XieYiUrl, url);
    }

    @Override
    public String getXieYiUrl() {
        return getString(Key_XieYiUrl);
    }

    @Override
    public void setShow(boolean b) {
        put(Key_setShow, b);
    }

    @Override
    public boolean getShow() {
        return getBoolean(Key_setShow);
    }


    @Override
    public void setUserName(String name) {

        put(Key_User_Name, name);

    }

    @Override
    public String getUserName() {
        return getString(Key_User_Name);
    }

    @Override
    public void setIsLogin(boolean b) {
        put(Key_Is_Login, b);
    }

    @Override
    public boolean getIsLogin() {
        return getBoolean(Key_Is_Login);
    }

    @Override
    public void setUserToken(String token) {
        put(Key_Token, token);
    }

    @Override
    public String getUserToken() {
        return getString(Key_Token);
    }

    @Override
    public void setUserIdentity(String identity) {


        put(Key_Identity, identity);
    }

    @Override
    public String getUserIdentity() {
        return getString(Key_Identity);
    }

    @Override
    public void setUserHeadUrl(String url) {
        put(Key_User_Head_Url, url);
    }

    @Override
    public String getUserHeadUrl() {
        return getString(Key_User_Head_Url);
    }

    @Override
    public void setUserPhone(String phone) {
        put(Key_User_Phone, phone);
    }

    @Override
    public String getUserPhone() {
        return getString(Key_User_Phone);
    }

    @Override
    public void setQiNiuToken(String phone) {
        put(Key_Qi_Niu_Token, phone);
    }

    @Override
    public String getQiNiuToken() {
        return getString(Key_Qi_Niu_Token);
    }

    @Override
    public void setQiNiuUrl(String url) {
        put(Key_Qi_Niu_Url, url);
    }

    @Override
    public String getQiNiuUrl() {
        return getString(Key_Qi_Niu_Url);
    }

    @Override
    public void setYouMengPushToken(String token) {
        put(Key_You_Meng_Token, token);
    }

    @Override
    public String getYouMengPushToken() {
        return getString(Key_You_Meng_Token);
    }

    @Override
    public void setUserMoney(String money) {

        put(Key_User_Money, money);

    }

    @Override
    public String getUserMoney() {
        return getString(Key_User_Money);
    }

    @Override
    public void setMessageState(int msgState) {

        put(Key_Message_State, msgState);
    }

    @Override
    public int getMessageState() {
        return getInt(Key_Message_State);
    }

    @Override
    public void setConfigJson(String josn) {
        put(Key_Config_Json, josn);
    }

    @Override
    public String getConfigJson() {
        return getString(Key_Config_Json);
    }
}
